package config

import (
	"log"

	"github.com/spf13/viper"
)

type Config struct {
	Mysql
	Huyi
}
type Huyi struct {
	Ak string
	Sk string
}
type Mysql struct {
	User     string
	Host     string
	Port     int
	Password string
	Database string
}

var ConfigOnfileData Config

func InitViper() {
	viper.SetConfigFile("../../hasic/config/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&ConfigOnfileData)
	log.Println("viper is success", ConfigOnfileData)
}
